package com.kuang.demo.controller.wx;

import com.kuang.demo.bean.BaseRespVo;
import com.kuang.demo.mapper.wx.WxCategoryMapper;
import com.kuang.demo.service.wx.WxCategoryService;
import com.kuang.demo.vo.wx.WxQueryCategoryIndexVO;
import com.kuang.demo.vo.wx.WxQueryCurrentCategoryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 郭浩 on 2020/11/5 17:27
 */
@RestController
@RequestMapping("wx/catalog")
public class WxCategoryController {

    @Autowired
    WxCategoryService wxCategoryService;
    @GetMapping("index")
    public BaseRespVo indexCategory(){
        WxQueryCategoryIndexVO wxQueryCategoryIndexVO = wxCategoryService.indexCategory();
        return BaseRespVo.ok(wxQueryCategoryIndexVO);
    }

    @GetMapping("current")
    public BaseRespVo currentCategory(Integer id){
        WxQueryCurrentCategoryVO wxQueryCurrentCategoryVO = wxCategoryService.queryCategoryById(id);
        return BaseRespVo.ok(wxQueryCurrentCategoryVO);
    }


}
